package com.wdl.modules.myhouse.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wdl.modules.myhouse.common.Result;
import com.wdl.modules.myhouse.entity.FileEntity;
import com.wdl.modules.myhouse.common.MyPage;
import com.wdl.modules.myhouse.vo.FileVo;
import org.springframework.scheduling.annotation.Async;

import java.util.Map;

/**
 * 文件表
 *
 * @author lucain sunlightcs@gmail.com
 * @since 1.0.0 2022-08-13
 */
public interface FileService extends IService<FileEntity> {

    IPage<FileVo> getAllFileVo(MyPage pageParam,String cat);

    IPage<FileVo> getFileByKeyWord(String keyWord, MyPage page);

    /**
     * 统计文件上传数量
     * @param year
     * @param month
     * @return
     */
    Map<String, Integer> staticByDay(Integer year, Integer month);

    /**
     * 下载量统计
     * @param year
     * @param month
     * @return
     */
    Map<String, Integer> downLoadstatisticByDay(Integer year, Integer month);

    /**
     * 保存爬虫数据
     * @return
     */
    Result<String> saveSpiderData();

    @Async
    Result<String> saveSpiderTopicRes();

    /**
     * 根据id获取文件详细信息
     * @param id
     * @return
     */
    FileVo getFileDetailById(Long id);
}